function hfile = fmr_LoadSTC(hfile)
% FMR::LoadSTCs  - load transio STC(s) of an FMR into memory
%
% FORMAT:       fmr.LoadSTCs;
%
% No input/output fields.

% Version:  v0.7g
% Build:    9080507
% Date:     Aug-05 2009, 7:48 PM CEST
% Author:   Jochen Weber, SCAN Unit, Columbia University, NYC, NY, USA
% URL/Info: http://wiki.brainvoyager.com/BVQXtools

% argument check
if nargin ~= 1 || ...
    numel(hfile) ~= 1 || ...
   ~isBVQXfile(hfile, 'fmr')
    error( ...
        'BVQXfile:BadArgument', ...
        'Invalid call to %s.', ...
        mfilename ...
    );
end

% try to load transio objects
bc = bvqxfile_getcont(hfile.L);
for sc = 1:numel(bc.Slice)
    if istransio(bc.Slice(sc).STCData)
        try
            bc.Slice(sc).STCData = resolve(bc.Slice(sc).STCData);
        catch
            error( ...
                'BVQXfile:transioError', ...
                'Error resolving transio access.' ...
            );
        end
    end
end

% set back to memory
bvqxfile_setcont(hfile.L, bc);
